package com.bbcare.followup.plat.service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import com.bbcare.followup.plat.dto.request.PatientPageReqDTO;
import com.bbcare.followup.plat.dto.request.PatientUpdateStatusReqDTO;
import com.bbcare.followup.plat.entity.Patient;
import com.bbcare.followup.plat.entity.PatientContentData;
import com.bbcare.followup.plat.entity.PatientTask;

import com.bbcare.followup.plat.entity.PhysiqueInfo;
import redis.clients.jedis.Jedis;

import javax.servlet.http.HttpServletRequest;

/**
 * @name: 患者队列服务类接口
 * @author: DemonLee
 * @createTime: 2017.4.11
 * @description: 患者建档基本信息等
 * @modify:
 *
 */
public interface IPatientService {

    // 患者信息List接口
    public List<Patient> getPatientList(Map<String, Object> paramMap) throws Exception;

    // 患者信息List接口
    public List<Object> getPatientByPhoneNo(Map<String, Object> paramMap) throws Exception;

    // 患者添加接口
    public Map<String, Object> registerPatient(Map<String, Object> servParamMap) throws Exception;

    // 扫码建档接口
    public Map<String, Object> registerPatientForQrcode(Map<String, Object> servParamMap) throws Exception;

    // 患者队列信息接口
    public HashMap<String, Object> qryPatientQueueSchemeList(Map<String, Object> paramMap) throws Exception;

    // 患者统计数据接口
    public HashMap<String, Object> qryPatientQueueStatistics(Map<String, Object> paramMap) throws Exception;

    // 患者所在队列的任务列表接口
    public List<Object> qryPatientTaskList(Map<String, Object> paramMap) throws Exception;

    // 患者任务内容列表接口
    public HashMap<String, Object> qryPatientContentList(Map<String, Object> paramMap) throws Exception;

    PhysiqueInfo getPhysiqueInfo(String taskId) throws Exception;
    // 患者任务内容修改接口
    public void modTaskContentData(Map<String, Object> servParamMap) throws Exception;

    Patient getPatient(Map<String, Object> paramMap) throws Exception;

    // 患者专科袋任务类别查询接口
    public HashMap<String, Object> qryPatientContentCategory(Map<String, Object> paramMap) throws Exception;

    // 患者专科袋详情查询接口
    public HashMap<String, Object> qryPatientContentDetail(Map<String, Object> paramMap) throws Exception;

    // 患者操作记录查询接口
    public HashMap<String, Object> qryPatientOperationList(Map<String, Object> paramMap) throws Exception;

    // 患者主页 ，患者详细信息查询
    public Map<String, Object> qryPatientDetail(Map<String, Object> paramMap) throws Exception;

    // 医生主页-患者统计数据接口
    public Map<String, Object> qryPatientStatistics(Map<String, Object> paramMap) throws Exception;

    // 获取患者已过期未处理的任务list接口
    public List<PatientTask> getPatientExpieredTaskList(Map<String, Object> servParamMap) throws Exception;

    // 获取失访需要结案的任务
    public List<PatientTask> selectCloseTask(Map<String, Object> servParamMap) throws Exception;

    // 处理患者已过期未处理的任务接口
    public void dealPatientExpieredTask(Map<String, Object> servParamMap) throws Exception;

    // 根据用户id+患者队列实例id查询患者信息接口
    public Map<String, Object> getPatientInfoByUserIdAndPtSchemeId(Map<String, Object> paramMap) throws Exception;

    // 根据门诊号查询患者信息
    public List<Map<String, Object>> getPatientInfoByOutNo(Map<String, Object> paramMap) throws Exception;

    // 根据门诊号更新患者信息
    public void modPatientInfoByOutNo(Map<String, Object> servParamMap) throws Exception;

    // 数据中心随访患者信息查询接口
    public HashMap<String, Object> qryPatientListDataCenter(Map<String, Object> paramMap) throws Exception;

    // 获取队列名称通用接口
    public Map<String, Object> getQueueName(Map<String, Object> paramIn, Jedis jedis) throws Exception;

    // 获取方案名称通用接口
    public Map<String, Object> getSchemeName(Map<String, Object> paramIn, Jedis jedis) throws Exception;

    // 获取模板内容通用接口
    public Map<String, Object> getContTemplData(Map<String, Object> paramIn) throws Exception;

    // 获取失访原因通用方法
    public Map<String, Object> getLostReason(Map<String, Object> paramIn, Jedis jedis) throws Exception;

    // 患者数据样本采集标志位更新接口
    void updatePatientSampleData(Map<String, Object> paramMap) throws Exception;

    // 患者异常记录接口
    public void savePtExcpInfo(Map<String, Object> servParamMap) throws Exception;

    // 调用生长发育曲线接口
    public Map<String, Object> dealGrowthDevApi(Map<String, Object> paramIn) throws Exception;

    // 根据租户和患者ID查询患者基本信息接口
    public Map<String, Object> getPatientInfoByUserId(Map<String, Object> paramMap) throws Exception;

    // 根据方案id校验方案版本信息接口
    public String registerQuery(String schemeId) throws Exception;

    public HashMap<String, Object> pageList(HashMap<String, Object> paramMap);

    // 患者基本信息校验及入表接口
    public Map<String, Object> dealPtBasicInfo(Map<String, Object> paramIn) throws Exception;

    // 建档任务需要考虑患者修改基本信息
    public Map<String, Object> dealTaskContUserInfo(Map<String, Object> paramIn) throws Exception;

    /**
     *
     * Edit by jiangq on 2022年01月18日
     * 近12个月用户数量
     * @param tenantId
     * @return
     */
    public List<Map<String, Object>> calcRecentUsers(String tenantId);

    /**
     * 患者列表
     * @param reqDTO
     * @param request
     * @return
     */
    Map<String, Object> patientListPage(PatientPageReqDTO reqDTO, HttpServletRequest request) throws Exception;

    /**
     * 修改患者在院状态
     * @param reqDTO
     * @param request
     * @return
     */
    void updatePatientStatus(PatientUpdateStatusReqDTO reqDTO, HttpServletRequest request) throws Exception;

    /**
     * 医院下拉选择列表
     * @param request
     * @return
     */
    List<String> hospitalList(HttpServletRequest request);


    /**
     * 根据patientId获取脑卒中量表的测量记录
     * @param patientId
     * @return
     */
    Map<String, Object> getNirnAssessData(String patientId);

    //根据患者id查询患者最近一次随访内容
    List<PatientContentData> queryPatientRecentlyFollowRecord(Map<String, Object> patientId);

    void updateAccessStatus(String userId, String accessStatus);
}
